KDIR=/lib/modules/$(shell uname -r)/build
MODULE_NAME=tri-fs

default :
	make -C $(KDIR) M=$(PWD) modules
	modinfo $(MODULE_NAME).ko

.PHONY : default

install : default
	sudo insmod $(MODULE_NAME).ko

.PHONY : install

mount :
	sudo mount -t trifs trifs ./ternary

.PHONY : mount

umount :
	sudo umount ./ternary

.PHONY : umount

remove :
	sudo rmmod $(MODULE_NAME)

.PHONY : remove

check :
	$(KDIR)/scripts/checkpatch.pl --no-tree --file $(MODULE_NAME).c

.PHONY : check

clean :
	make -C $(KDIR) M=$(PWD) clean

test :
	gcc -Wall -Werror -ggdb3 test_app.c -o test_app
